#!/usr/bin/bash

gsed -i 's/user = fpm/user = www/g' /opt/local/etc/php-fpm.d/www.conf
gsed -i 's|;env\[PATH\] = /usr/local/bin:/usr/bin:/bin|env[PATH] = /opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin|g' /opt/local/etc/php-fpm.d/www.conf
gsed -i 's/memory_limit = 128M/memory_limit = 512M/g' /opt/local/etc/php.ini
gsed -i 's/output_buffering = /;output_buffering = /g' /opt/local/etc/php.ini

log "starting php-fpm"
/usr/sbin/svcadm enable php-fpm

# ARG_NAME=enable_ldap
# if /usr/sbin/mdata-get ${ARG_NAME} 1>/dev/null 2>&1; then
#     ARG_VALUE=$(/usr/sbin/mdata-get ${ARG_NAME})
#     if [ "${ARG_VALUE}" == "true" ]; then
#         log "enable ldap"
#         sudo -u www php /var/www/html/occ app:enable user_ldap
#     fi
# fi

# /usr/sbin/svcadm restart php-fpm
